//
//  SWMusic.swift
//  ChildStory
//
//  Created by linhan on 2016/12/22.
//  Copyright © 2016年 Aiya. All rights reserved.
//

import Foundation


extension SWMusic
{
    convenience init(response:SWMusicRsp)
    {
        self.init()
        self.name = response.name
        self.artist = response.artist
        coverURL = response.coverURL
        thumbURL = response.thumbURL
        musicURL = response.musicURL
        durationString = response.durationString
    }
}

extension SWPoetry
{
    convenience init(response:SWPoetryRsp)
    {
        self.init()
        name = response.name
        artist = response.artist
        category = response.category
        summary = response.summary
        contentURL = response.contentURL
        dynasty = response.dynasty
    }
}

struct SWBanner
{
    var imageURL:String?
    var contentURL:String?
    
    init?(response:SWBannerRsp)
    {
        guard let imageURL = response.imageURL,imageURL != "" else {
            return nil
        }
        self.imageURL = imageURL
        self.contentURL = response.contentURL
    }
}
